package cn.laixueit;

import cn.laixueit.mapper.StudentMapper;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;
import java.util.Map;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:spring.xml")
public class Demo {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Test
    public void t(){
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList("select * from student");
        System.out.println(mapList);
    }

    @Autowired
    private StudentMapper studentMapper;

    @Test
    public void t2(){
        studentMapper.save2();
    }
}
